3.3.14 \(\int (d \sin (e+f x))^m (a+b \sin (e+f x))^2 \, dx\) [214]

Optimal. Leaf size=194 \[ -\frac {b^2 \cos (e+f x) (d \sin (e+f x))^{1+m}}{d f (2+m)}+\frac {\left (b^2 (1+m)+a^2 (2+m)\right ) \cos (e+f x) \, _2F_1\left (\frac {1}{2},\frac {1+m}{2};\frac {3+m}{2};\sin ^2(e+f x)\right ) (d \sin (e+f x))^{1+m}}{d f (1+m) (2+m) \sqrt {\cos ^2(e+f x)}}+\frac {2 a b \cos (e+f x) \, _2F_1\left (\frac {1}{2},\frac {2+m}{2};\frac {4+m}{2};\sin ^2(e+f x)\right ) (d \sin (e+f x))^{2+m}}{d^2 f (2+m) \sqrt {\cos ^2(e+f x)}} \]

[Out]

-b^2*cos(f*x+e)*(d*sin(f*x+e))^(1+m)/d/f/(2+m)+(b^2*(1+m)+a^2*(2+m))*cos(f*x+e)*hypergeom([1/2, 1/2+1/2*m],[3/
2+1/2*m],sin(f*x+e)^2)*(d*sin(f*x+e))^(1+m)/d/f/(1+m)/(2+m)/(cos(f*x+e)^2)^(1/2)+2*a*b*cos(f*x+e)*hypergeom([1
/2, 1+1/2*m],[2+1/2*m],sin(f*x+e)^2)*(d*sin(f*x+e))^(2+m)/d^2/f/(2+m)/(cos(f*x+e)^2)^(1/2)

________________________________________________________________________________________

Rubi [A]
time = 0.09, antiderivative size = 194, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.130, Rules used = {2868, 2722, 3093} \begin {gather*} \frac {\left (a^2 (m+2)+b^2 (m+1)\right ) \cos (e+f x) (d \sin (e+f x))^{m+1} \, _2F_1\left (\frac {1}{2},\frac {m+1}{2};\frac {m+3}{2};\sin ^2(e+f x)\right )}{d f (m+1) (m+2) \sqrt {\cos ^2(e+f x)}}+\frac {2 a b \cos (e+f x) (d \sin (e+f x))^{m+2} \, _2F_1\left (\frac {1}{2},\frac {m+2}{2};\frac {m+4}{2};\sin ^2(e+f x)\right )}{d^2 f (m+2) \sqrt {\cos ^2(e+f x)}}-\frac {b^2 \cos (e+f x) (d \sin (e+f x))^{m+1}}{d f (m+2)} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(d*Sin[e + f*x])^m*(a + b*Sin[e + f*x])^2,x]

[Out]

-((b^2*Cos[e + f*x]*(d*Sin[e + f*x])^(1 + m))/(d*f*(2 + m))) + ((b^2*(1 + m) + a^2*(2 + m))*Cos[e + f*x]*Hyper
geometric2F1[1/2, (1 + m)/2, (3 + m)/2, Sin[e + f*x]^2]*(d*Sin[e + f*x])^(1 + m))/(d*f*(1 + m)*(2 + m)*Sqrt[Co
s[e + f*x]^2]) + (2*a*b*Cos[e + f*x]*Hypergeometric2F1[1/2, (2 + m)/2, (4 + m)/2, Sin[e + f*x]^2]*(d*Sin[e + f
*x])^(2 + m))/(d^2*f*(2 + m)*Sqrt[Cos[e + f*x]^2])

Rule 2722

Int[((b_.)*sin[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[Cos[c + d*x]*((b*Sin[c + d*x])^(n + 1)/(b*d*(n + 1
)*Sqrt[Cos[c + d*x]^2]))*Hypergeometric2F1[1/2, (n + 1)/2, (n + 3)/2, Sin[c + d*x]^2], x] /; FreeQ[{b, c, d, n
}, x] &&  !IntegerQ[2*n]

Rule 2868

Int[((b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((c_) + (d_.)*sin[(e_.) + (f_.)*(x_)])^2, x_Symbol] :> Dist[2*c*(d/b)
, Int[(b*Sin[e + f*x])^(m + 1), x], x] + Int[(b*Sin[e + f*x])^m*(c^2 + d^2*Sin[e + f*x]^2), x] /; FreeQ[{b, c,
 d, e, f, m}, x]

Rule 3093

Int[((b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((A_) + (C_.)*sin[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> Simp[(-C)*Cos
[e + f*x]*((b*Sin[e + f*x])^(m + 1)/(b*f*(m + 2))), x] + Dist[(A*(m + 2) + C*(m + 1))/(m + 2), Int[(b*Sin[e +
f*x])^m, x], x] /; FreeQ[{b, e, f, A, C, m}, x] &&  !LtQ[m, -1]

Rubi steps

\begin {align*} \int (d \sin (e+f x))^m (a+b \sin (e+f x))^2 \, dx &=\frac {(2 a b) \int (d \sin (e+f x))^{1+m} \, dx}{d}+\int (d \sin (e+f x))^m \left (a^2+b^2 \sin ^2(e+f x)\right ) \, dx\\ &=-\frac {b^2 \cos (e+f x) (d \sin (e+f x))^{1+m}}{d f (2+m)}+\frac {2 a b \cos (e+f x) \, _2F_1\left (\frac {1}{2},\frac {2+m}{2};\frac {4+m}{2};\sin ^2(e+f x)\right ) (d \sin (e+f x))^{2+m}}{d^2 f (2+m) \sqrt {\cos ^2(e+f x)}}+\left (a^2+\frac {b^2 (1+m)}{2+m}\right ) \int (d \sin (e+f x))^m \, dx\\ &=-\frac {b^2 \cos (e+f x) (d \sin (e+f x))^{1+m}}{d f (2+m)}+\frac {\left (a^2+\frac {b^2 (1+m)}{2+m}\right ) \cos (e+f x) \, _2F_1\left (\frac {1}{2},\frac {1+m}{2};\frac {3+m}{2};\sin ^2(e+f x)\right ) (d \sin (e+f x))^{1+m}}{d f (1+m) \sqrt {\cos ^2(e+f x)}}+\frac {2 a b \cos (e+f x) \, _2F_1\left (\frac {1}{2},\frac {2+m}{2};\frac {4+m}{2};\sin ^2(e+f x)\right ) (d \sin (e+f x))^{2+m}}{d^2 f (2+m) \sqrt {\cos ^2(e+f x)}}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.22, size = 144, normalized size = 0.74 \begin {gather*} -\frac {\cos (e+f x) (d \sin (e+f x))^m \sin ^2(e+f x)^{\frac {1}{2} (-1-m)} \left (b^2 \, _2F_1\left (\frac {1}{2},\frac {1}{2} (-1-m);\frac {3}{2};\cos ^2(e+f x)\right ) \sin (e+f x)+a \left (a \, _2F_1\left (\frac {1}{2},\frac {1-m}{2};\frac {3}{2};\cos ^2(e+f x)\right ) \sin (e+f x)+2 b \, _2F_1\left (\frac {1}{2},-\frac {m}{2};\frac {3}{2};\cos ^2(e+f x)\right ) \sqrt {\sin ^2(e+f x)}\right )\right )}{f} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(d*Sin[e + f*x])^m*(a + b*Sin[e + f*x])^2,x]

[Out]

-((Cos[e + f*x]*(d*Sin[e + f*x])^m*(Sin[e + f*x]^2)^((-1 - m)/2)*(b^2*Hypergeometric2F1[1/2, (-1 - m)/2, 3/2,
Cos[e + f*x]^2]*Sin[e + f*x] + a*(a*Hypergeometric2F1[1/2, (1 - m)/2, 3/2, Cos[e + f*x]^2]*Sin[e + f*x] + 2*b*
Hypergeometric2F1[1/2, -1/2*m, 3/2, Cos[e + f*x]^2]*Sqrt[Sin[e + f*x]^2])))/f)

________________________________________________________________________________________

Maple [F]
time = 1.07, size = 0, normalized size = 0.00 \[\int \left (d \sin \left (f x +e \right )\right )^{m} \left (a +b \sin \left (f x +e \right )\right )^{2}\, dx\]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((d*sin(f*x+e))^m*(a+b*sin(f*x+e))^2,x)

[Out]

int((d*sin(f*x+e))^m*(a+b*sin(f*x+e))^2,x)

________________________________________________________________________________________

Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*sin(f*x+e))^m*(a+b*sin(f*x+e))^2,x, algorithm="maxima")

[Out]

integrate((b*sin(f*x + e) + a)^2*(d*sin(f*x + e))^m, x)

________________________________________________________________________________________

Fricas [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*sin(f*x+e))^m*(a+b*sin(f*x+e))^2,x, algorithm="fricas")

[Out]

integral(-(b^2*cos(f*x + e)^2 - 2*a*b*sin(f*x + e) - a^2 - b^2)*(d*sin(f*x + e))^m, x)

________________________________________________________________________________________

Sympy [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*sin(f*x+e))**m*(a+b*sin(f*x+e))**2,x)

[Out]

Timed out

________________________________________________________________________________________

Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*sin(f*x+e))^m*(a+b*sin(f*x+e))^2,x, algorithm="giac")

[Out]

integrate((b*sin(f*x + e) + a)^2*(d*sin(f*x + e))^m, x)

________________________________________________________________________________________

Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int {\left (d\,\sin \left (e+f\,x\right )\right )}^m\,{\left (a+b\,\sin \left (e+f\,x\right )\right )}^2 \,d x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((d*sin(e + f*x))^m*(a + b*sin(e + f*x))^2,x)

[Out]

int((d*sin(e + f*x))^m*(a + b*sin(e + f*x))^2, x)

________________________________________________________________________________________